<!--工具页面-->
<template>
    <div class="_page tools-page">
        <div class="note-list">
            <strong>工具集合</strong>
            <ul class="item-list">
                <li v-for="(item, index) in datas" :key="index" @click="toPage(item.path)">
                    <div>{{ item.title }}</div>
                    <i></i>
                    <span>{{ item.time }}</span>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
import toolsDatas from '@/config/tools.json'
import { ref } from 'vue'
import { useRouter } from 'vue-router'

export default {
    setup () {
        const router = useRouter()
        const datas = ref(toolsDatas.sort((a, b) => a.time > b.time ? -1 : 1))

        const toPage = (path) => {
            router.push({ path })
        }

        return {
            datas,
            toPage
        }
    }
}
</script>

<style lang="scss">
    @use './style.scss';
</style>
